import 'package:dio/dio.dart';

BaseOptions options = new BaseOptions(
  connectTimeout: 4000
);

Dio dio = new Dio(options);

Future<Response> ajaxGet(String url, Map queryParams) async {
  Response res = await dio.get(url, queryParameters: queryParams);
  return res;
}

Future<Map<String, dynamic>> ajaxPost(String url, Map postData) async {
  Response res = await dio.post(url, data: postData);
  Map result = new Map<String, dynamic>.from(res.data);
  return result;
}